package com.cq.hd.member.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cq.hd.common.utils.BeanUtils;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.mapper.*;
import com.cq.hd.member.po.*;
import com.cq.hd.member.service.TbWithdrawalBillPaymentVoucherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 提现-打款凭证 服务实现类
 * </p>
 */
@Service
@Slf4j
public class TbWithdrawalBillPaymentVoucherServiceImpl extends ServiceImpl<TbWithdrawalBillPaymentVoucherMapper, TbWithdrawalBillPaymentVoucherPo> implements TbWithdrawalBillPaymentVoucherService {
    // 保存提现打款凭证
    @Override
    public boolean saveByDto(AdminWithdrawalBillPaymentVoucherDto adminWithdrawalBillPaymentVoucherDto) {
        TbWithdrawalBillPaymentVoucherPo po = new TbWithdrawalBillPaymentVoucherPo();
        BeanUtils.copyProperties(adminWithdrawalBillPaymentVoucherDto, po);
        po.setCreateTime(LocalDateTime.now());
        po.setUpdateTime(LocalDateTime.now());

        return save(po);
    }

    @Override
    public TbWithdrawalBillPaymentVoucherPo getByDto(AdminWithdrawalBillPaymentVoucherDto adminWithdrawalBillPaymentVoucherDto) {
        return baseMapper.getByDto(adminWithdrawalBillPaymentVoucherDto);
    }
}
